<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
    一个字符串，该字符串用于创建对象的默认 字符串描述。
    由内置方法 Object.prototype.toString()使用
     */

    let s = new Set()
    console.log('toString()', s.toString()) // [object Set]
    console.log(s[Symbol.toStringTag]) //  Set


    class Foo {
    }

    let foo = new Foo();
    console.log(foo);   // Foo {}
    console.log(foo.toString());        // [object Object]
    console.log(foo[Symbol.toStringTag]);       // undefined

    class Bar {
        constructor() {
            this[Symbol.toStringTag] = 'Bar';
        }
    }

    let bar = new Bar();
    console.log(bar);       // Bar {}
    console.log(bar.toString());        // [object Bar]
    console.log(bar[Symbol.toStringTag]);       // Bar


</script>
</body>
</html>